import 'package:amway_superapp_creator_plugin/config/colors_config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';

/*
* 兴趣标签
* */
class InterestLabel extends StatelessWidget {
  VoidCallback callback;
  List<Widget> list;
  bool xqIsNull = false;

  InterestLabel(this.list, this.xqIsNull, {Key key, this.callback})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        callback();
      },
      child: Row(
        children: [
          Container(
            margin: EdgeInsets.fromLTRB(
                ScreenUtil().setHeight(16),
                ScreenUtil().setHeight(16),
                ScreenUtil().setHeight(20),
                ScreenUtil().setHeight(16)),
            child: Text("兴趣标签",
                style: TextStyle(
                    fontWeight: FontWeight.bold,
                    color: const Color(0xFF2C2C2C),
                    fontSize: ScreenUtil().setSp(16))),
          ),
          Expanded(
            child: list.isEmpty
                ? Text(
                    "选择您的兴趣标签",
                    textAlign: TextAlign.end,
                    style: TextStyle(
                        color: xqIsNull == false
                            ? Color(0x4D000000)
                            : ColorsConfig.c_cd0000,
                        fontSize: ScreenUtil().setSp(16)),
                  )
                : Container(
                    alignment: Alignment.centerRight,
                    height: ScreenUtil().setHeight(26),
                    child: ListView(
                        scrollDirection: Axis.horizontal,
                        shrinkWrap: true,
                        children: list),
                  ),
          ),
          Container(
              margin: EdgeInsets.only(left: ScreenUtil().setWidth(5),right: ScreenUtil().setWidth(12)),
              child: Image.asset(
                'picture/icon_right.png',
                package: 'amway_superapp_creator_plugin',
              ))
        ],
      ),
    );
  }
}
